<template>
  <div class="my">
    <div class="my_bg">
      <div class="content">
        <div class="phone">{{ phone }}</div>
        <div class="card_box">
          <div class="card_item" @click="handleClick('personalData')">
            <img class="image" src="../../assets/icon_gerrenziliao.png">
            <div class="title">{{ $t('personal_data') }}</div>
          </div>
          <div class="card_item" @click="handleClick('order')">
            <img class="image" src="../../assets/icon_daikuan.png">
            <div class="title">{{ $t('loan_my') }}</div>
          </div>
          <div class="card_item" @click="handleClick('set')">
            <img class="image" src="../../assets/icon_shezhi.png">
            <div class="title">{{ $t('set') }}</div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import {computed} from 'vue'
import router from "@/router";
import {fetchUserInfo} from "@/api/my";
import {processNext} from "@/utils/tool";
import {userInfoVerify} from "@/api/home";
import {useStore} from "vuex";

export default {
  setup() {
    const phone = computed(() => {
      return localStorage.getItem('phone')
    })
    const store = useStore()
    const handleClick = async (value) => {
      switch (value) {
        case 'personalData':
          if (!localStorage.getItem('userId')) {
            return router.push('/login')
          }
            router.push('/personalData')
          break
        case 'order':
          router.push('/order/index')
          break
        case 'set':
          router.push('/mySet')
      }
    }
    store.dispatch('changeLoading', false)
    return {
      phone,
      handleClick
    }
  }
}
</script>

<style lang="less" scoped>
.my {
  width: 100%;
}

.my_bg {
  position: relative;
  width: 100%;
  text-align: center;
  z-index: 1;
  overflow: hidden;
  background-color: #F7F7F7;

  .content {
    padding-top: 50px;

    .phone {
      margin-bottom: 30px;
      color: #FFFFFF;
      height: 30px;
      font-size: 24px;
    }

    .card_box {
      width: 330px;
      border-radius: 8px;
      background: #FFFFFF;
      margin: 0 auto;
      box-shadow: 0px 7px 43px 0px rgba(30, 30, 30, 0.05);
      display: flex;

      .card_item {
        width: 33.3333%;
        text-align: center;
        padding: 5px 0;

        .image {
          width: 60px;
          height: 60px;
        }

        .title {
          font-size: 12px;
          text-align: center;
          font-weight: 600;
        }
      }
    }
  }

}

.my_bg::before {
  width: 140%;
  height: 150px;
  position: absolute;
  left: -20%;
  top: 0;
  content: '';
  border-radius: 0 0 50% 50%;
  z-index: -1;
  background-color: #FF5A50;
}
</style>
